package com.tencent.iov.cowin.befsale.clue.value.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Describe: crm 方对应的状态
 * @author: zly
 * @created: 2022-01-27
 * @version: 1.0
 */
@Getter
@AllArgsConstructor
public enum CrmStatusEnum {

    crm_status_1(1,"新建"),
    crm_status_2(2,"已下发"),
    crm_status_3(3,"已撞单"),
    crm_status_4(4,"已失效"),
    crm_status_5(5,"已拒绝"),
    crm_status_6(6,"待分配"),
    crm_status_7(7,"已分配"),
    crm_status_8(8,"申请战败"),
    crm_status_9(9,"战败"),
    crm_status_10(10,"待到店"),
    crm_status_11(11,"待试驾"),
    crm_status_12(12,"已试驾"),
    crm_status_13(13,"已报价"),
    crm_status_14(14,"已下订"),
    crm_status_15(15,"实销/赢单"),
    crm_status_16(16,"已回访"),
    crm_status_17(17,"自测"),
    crm_status_18(18,"跟进中"),
    crm_status_19(19,"已超期"),
    crm_status_20(20,"申请失效"),
    crm_status_21(21,"待下发"),
    crm_status_22(22,"已交车");

    Integer code;
    String name;


    public static CrmStatusEnum getCrmStatusByCode(Integer code) {
        return Stream.of(CrmStatusEnum.values())
                .filter(crmStatusEnum -> crmStatusEnum.code.equals(code)).findAny().orElse(null);
    }
}
